﻿<%@ Page Language="C#"  MasterPageFile="~/MasterPage.master" AutoEventWireup="true" Inherits="Nivdal.Country" Title="" StylesheetTheme="SkinFile" Codebehind="Country.aspx.cs" %>

<asp:Content ID="PageNameContent" ContentPlaceHolderID="PageNamePlaceHolder" runat="server">
    <asp:Label ID="PageNameLabel" runat="server" Text='<%# Resources.Resource.Global_National+ ">>"%>' CssClass="PageNameContentStyle"></asp:Label>
    <script language="javascript" type="text/javascript">
        function ShowSchedule() {
            $("#showschedule").hide();
            $("#schedule").show();            
        }
    
    </script>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="basic_element">
    <asp:Label ID="ErrorLabel" runat="server" Text=""></asp:Label>
    <table>
    <tr>
    <td style="width:55%; vertical-align:top;">
    <asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource1">
    <ItemTemplate>
    <div class="red_title_no_padding">
        <div class="grey_title_inside_red floater">
          <asp:Label ID="CountryNameLabel" runat="server" Text='<%# Eval("Name") %>' CssClass="team_name_white"></asp:Label>
        </div>
        <div class="grey_title_triangle floater"></div>
          <asp:Image ID="FlagImage" runat="server" ImageUrl='<%# Eval("Flag", "~/Images/Flags/{0}") %>' AlternateText='<%# Eval("Name") %>' />
            <asp:ImageButton ID="ForumImageButton" runat="server" ToolTip='<%# Eval("Name","{0} national public forum") %>'
            PostBackUrl='<%# Eval("ForumId","~/ForumDetails.aspx?Id={0}") %>'
            ImageUrl="~/Images/Icons/forum.png" />
        </div>
        
        
    </div>
    <div class="padding5">
    <table cellpadding="5" style="width:100%;">
        <tr>
            <td colspan="2">
                    <h1>
                    </h1>
            </td>
        </tr>
        <tr>
            <td style="width:50%;"><asp:Label ID="ActiveusersTitleLabel" runat="server" Text="<%$ Resources:Resource, Country_ActiveusersTitleLabel %>" SkinID="InfoLabel"></asp:Label></td>
            <td style="width:50%;"><asp:Label ID="ActiveusersLabel1" runat="server" Text='<%# Eval("Number of Active Users") %>' SkinID="GridLabel"></asp:Label></td>
        </tr>
        <tr>
            <td><asp:Label ID="NumberOfTeamsTitleLabel" runat="server" Text="<%$ Resources:Resource, Country_NumberOfTeamsTitleLabel %>" SkinID="InfoLabel"></asp:Label></td>
            <td><asp:Label ID="NumberOfTeamsLabel" runat="server" Text='<%# Eval("Team") %>' SkinID="GridLabel" /></td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="ChampionTitleLabel" runat="server" Text="<%$ Resources:Resource, Country_ChampionTitleLabell %>" SkinID="InfoLabel"></asp:Label>
            </td>
            <td>
                <asp:Hyperlink ID="ChampionLinkButton" runat="server" Text='<%# Eval("ChampionName") %>' SkinID="GreenTitleHyperLink"
                    NavigateUrl='<%# Eval("ChampionId", "~/TeamHomePage.aspx?TeamId={0}") %>'></asp:Hyperlink>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="CupWinnerTitleLabel" runat="server" Text="<%$ Resources:Resource, Country_CupWinnerTitleLabel %>" SkinID="InfoLabel"></asp:Label>
            </td>
            <td>
                <asp:Hyperlink ID="CupWinnerLinkButton" runat="server" Text='<%# Eval("CupWinnerName") %>' SkinID="GreenTitleHyperLink"
                    NavigateUrl='<%# Eval("CupWinnerId", "~/TeamHomePage.aspx?TeamId={0}") %>'></asp:Hyperlink>
            </td>
        </tr>
        <tr>
            <td style="width:50%;">
                <asp:Label ID="LeagueDateTitleLable" runat="server" Text="<%$ Resources:Resource, Country_LeagueDateTitleLable %>" SkinID="InfoLabel"></asp:Label>
            </td>
            <td style="width:50%;">
                <asp:Label ID="LeagueDateeLable" runat="server" Text='<%# Eval("LeagueDate") %>' SkinId="GridLabel"></asp:Label>
                <br />
                <asp:Label ID="LocalLeagueDateLabel" runat="server" Text='<%# "( " + Eval("LocalLeagueDate") +  " " + Resources.Resource.Country_LocalTimeText +" )" %>' 
                SkinId="GridLabel"></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="CupDateTitleLabel" runat="server" Text="<%$ Resources:Resource, Country_CupDateTitleLabel %>" SkinID="InfoLabel"></asp:Label>
            </td>
            <td>
                <asp:Label ID="CupDateLabel" runat="server" Text='<%# Eval("CupDate") %>' SkinID="GridLabel"></asp:Label>
                <br />
                <asp:Label ID="LocalCupDateLabel" runat="server" Text='<%# "( " + Eval("LocalCupDate") +  " " + Resources.Resource.Country_LocalTimeText +" )" %>'
                    SkinID="GridLabel"></asp:Label>
            </td>
        </tr>
    </table>
                    
    <div id="schedule" style="display:none;">
    <table cellpadding="5" style="width:100%;">
        <tr>
            <td>
                <asp:Label ID="NextTrainingTitleLabel" runat="server" Text="<%$ Resources:Resource, Country_NextTrainingTitleLabel %>" SkinID="InfoLabel"></asp:Label>
            </td>
            <td>
                <asp:Label ID="NextTrainingLabel" runat="server" Text='<%# Eval("NextTrainingDate")%>' SkinID="GridLabel"></asp:Label>
                <br />
                <asp:Label ID="NextTrainingLocalLabel" runat="server" Text='<%# "( " + Eval("LocalNextTrainingDate") + " " + Resources.Resource.Country_LocalTimeText +" )"%>'
                    SkinID="GridLabel"></asp:Label>
            </td>
        </tr>
        <asp:Repeater ID="OtherSchedule" runat="server" DataSourceID="OtherScheduleDataSource">
        <ItemTemplate>
        <tr>
        <td>
            <asp:Label ID="RoutineNameLabel" runat="server" SkinID="InfoLabel" Text='<%# Eval("RoutineName") %>'></asp:Label>
        </td>
        <td>
            <asp:Label ID="RoutineDayToRunLabel" runat="server" Text='<%# Eval("DayToRun") + " " %>'
                Visible='<%# Eval("ShowDay") %>' SkinID="GridLabel"></asp:Label>
            <asp:Label ID="TimeToRunLabel" runat="server" Text='<%# Eval("TimeToRun") %>' SkinID="GridLabel"></asp:Label>
            <br />
            <asp:Label ID="OpenBracketsLabel" runat="server" Text="(" SkinID="GridLabel"></asp:Label>
            <asp:Label ID="LocalDatLabel" runat="server" Text='<%# Eval("LocalDayToRun") + " " %>' 
            SkinID="GridLabel" Visible='<%# Eval("ShowDay") %>'></asp:Label>
            <asp:Label ID="LocalTime" runat="server" Text='<%# Eval("LocalTimeToRun") %>' SkinID="GridLabel"></asp:Label>
            <asp:Label ID="CloseBracketsLabel" runat="server" Text='<%# Resources.Resource.Country_LocalTimeText + " )" %>' SkinID="GridLabel"></asp:Label>
        </td>
        </tr>
        </ItemTemplate>                            
        </asp:Repeater>
    </table>
    </div>     
    <asp:Panel ID="NationalTeamLink" runat="server" Visible='<%# Eval("NationalTeamEnabled") %>'>
        <asp:HyperLink ID="NationalTeamHyperlink" runat="server" Text='<%# Eval("NationalTeamName") %>'
        NavigateUrl='<%# "~/NationalTeam.aspx?Id=" + Eval("NationalTeamId") %>' SkinID="GreenTitleHyperLink"></asp:HyperLink>
        <br />
    </asp:Panel>
    <asp:Panel ID="YouthTeamLink" runat="server" Visible='<%# Eval("YouthTeamEnabled") %>'>
        <asp:HyperLink ID="YouthTeamHyperlink" runat="server" Text='<%# Eval("YouthTeamName") %>'
        NavigateUrl='<%# "~/NationalTeam.aspx?Id=" + Eval("YouthTeamId") %>' SkinID="GreenTitleHyperLink"></asp:HyperLink>
        <br />
    </asp:Panel> 
    </div>
    </ItemTemplate>                 
    </asp:FormView>  
    <div class="padding5">
                
                 
    <div id="showschedule">
        <asp:LinkButton ID="LocalScheduleLink" runat="server" Text="<%$ Resources:Resource, Country_LocalSchedule %>"
            OnClientClick="javascript:ShowSchedule(); return false;" SkinID="GreenTitleLink" ></asp:LinkButton>
    </div>            
    <asp:Hyperlink ID="NationalCupLinkButton" runat="server" Text="<%$ Resources:Resource, Global_NationalCup %>"  
    SkinID="GreenTitleHyperLink"></asp:Hyperlink>
    <br />
    <asp:Hyperlink ID="CountriesLinkButton" runat="server" SkinID="GreenTitleHyperLink" Text="<%$ Resources:Resource, Global_Countries %>" 
        NavigateUrl="~/Countries.aspx"></asp:Hyperlink>
    <br />
    <asp:HyperLink ID="BonusPromotionsInfoHyperlink" runat="server" SkinID="GreenTitleHyperLink"
        Text="<%$ Resources:Resource, Country_BonusPromotionsLinkText %>"></asp:HyperLink>
    <br />
    <asp:Hyperlink ID="ElectionsHyperlink" runat="server" SkinID="GreenTitleHyperLink"
        Text="<%$ Resources:Resource, Global_Elections %>" ></asp:Hyperlink>
    <br />
    <asp:HyperLink ID="NewspaperHyperlink" runat="server" SkinID="GreenTitleHyperLink" 
    Text="<%$ Resources:Resource, Country_LocalNewspaper %>"></asp:HyperLink>
    <br />
    </div>        

    </td>
    <td style="width:45%; vertical-align:top; padding-left:20px;">

        <asp:Label ID="TopLeagueNameLabel" runat="server" Text="<%$ Resources:Resource, Country_TopLeagueNameLabel %>" SkinID="InfoLabel"></asp:Label>
        <asp:Hyperlink ID="TopLeagueNameLinkButton" runat="server" SkinID="GreenTitleHyperLink"></asp:Hyperlink>
        <br />
        <asp:GridView ID="GridView4" runat="server" DataSourceID="SqlDataSource2" SkinID="Professional"
        AutoGenerateColumns="False">
            <Columns>
                <asp:TemplateField HeaderText="">
                    <ItemTemplate>
                        <asp:Label ID="Label18" runat="server" Text='<%# Eval("N")%>' SkinID="GridLabel" ></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="TeamNameLabel" ToolTip="<%$ Resources:Resource, Global_TeamName %>" runat="server" Text="<%$ Resources:Resource, Global_TeamName %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink2" runat="server" Text='<%# Eval("Team Name") %>' NavigateUrl='<%# Eval("TeamId ", "TeamHomePage.aspx?TeamId={0}") %>'
                            SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="GALabel" ToolTip="<%$ Resources:Resource, Global_Games %>" runat="server" Text="<%$ Resources:Resource, Global_GamesHeader %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("Games")%>' SkinID="GridLabel"> </asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="PLabel" ToolTip="<%$ Resources:Resource, Global_Points %>" runat="server" Text="<%$ Resources:Resource, Country_PLabel %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("P")%>' SkinID="GridLabel"> </asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="GOLabel" ToolTip="<%$ Resources:Resource, Global_Goals %>" runat="server" Text="<%$ Resources:Resource, Global_GoalsHeader %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("Goals")%>' SkinID="GridLabel"> </asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <br /><br />
        <asp:Label ID="Last5JoinedUsers" runat="server" Text="<%$ Resources:Resource, Country_LastUsersJoined %>" SkinID="InfoLabel"></asp:Label>
        <br />
        <asp:Repeater ID="JoinedUsersRepeater" runat="server" DataSourceID="JoinedUsersDataSource">
        <ItemTemplate>
            <asp:HyperLink ID="UserHyperLink" runat="server" Text='<%# Eval("PublicName") %>' 
                NavigateUrl='<%# "~/UserPage.aspx?Id=" + Eval("UserId") %>' SkinID="GreenTitleHyperLink"></asp:HyperLink>
        </ItemTemplate>
        <SeparatorTemplate>&nbsp;</SeparatorTemplate>
        </asp:Repeater>
        <br /><br />
        <asp:Label ID="ManagersTitleLabel" runat="server" Text="<%$ Resources:Resource, Search_UsersText %>" SkinID="InfoLabel"></asp:Label>
        <br />
        <asp:Repeater ID="ManagersRepeater" runat="server" DataSourceID="ManagersDataSource">
            <ItemTemplate>
                <asp:Image ID="UserIconImage" runat="server" ImageUrl='<%# "Images/Icons/" + Eval("RoleImageName") %>'
                    ToolTip='<%# Eval("UserRoleName") %>' />
                <asp:HyperLink ID="UserHyperLink" runat="server" Text='<%# Eval("PublicName") %>' 
                    NavigateUrl='<%# "~/UserPage.aspx?Id=" + Eval("UserId") %>' SkinID="GreenTitleHyperLink"></asp:HyperLink>
            </ItemTemplate>
            <SeparatorTemplate>&nbsp;</SeparatorTemplate>
        </asp:Repeater>
        <br /><br />
        <asp:Label ID="OnlineUsersTitleLabel" runat="server" SkinID="InfoLabel"
            Text="<%$ Resources:Resource, BigMasterPage_OnlineUsersToolTip %>"></asp:Label>
        <br />
        <asp:Repeater ID="OnlineUsersRepeater" runat="server" DataSourceID="OnlineUsersDataSource">
            <ItemTemplate>
                <%--<asp:Image ID="UserroleImage" runat="server" ImageUrl='<%# "Images/Icons/" + Eval("RoleImageName") %>'
                    ToolTip='<%# Eval("UserRoleName") %>' />--%>
                    <asp:HyperLink ID="UserHyperLink" runat="server" Text='<%# Eval("UserName") %>' 
                    NavigateUrl='<%# "~/UserPage.aspx?Id=" + Eval("UserId") %>' SkinID="GreenTitleHyperLink"></asp:HyperLink>

            </ItemTemplate>            
            <SeparatorTemplate>&nbsp;</SeparatorTemplate>
        </asp:Repeater>
            
            
            
        <asp:SqlDataSource ID="JoinedUsersDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_GetLastUsersJoinedCountry" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource> 
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_ShowLeagueTable" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>      
        <asp:SqlDataSource ID="OtherScheduleDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_GetCountryExtendedSchedule" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>   
        <asp:SqlDataSource ID="ManagersDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_GetCountryManagers" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
        <asp:SqlDataSource ID="OnlineUsersDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_ShowConnectedUsersFromCountry" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
    </td>
    </tr>
    </table>
    </div>


    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="Nivdal_ShowCountryDetails" SelectCommandType="StoredProcedure">
    </asp:SqlDataSource>

</asp:Content>

